﻿import QtQuick
import QtQuick.Controls.Basic
import QtQuick.Templates as T
import FilUI

T.ItemDelegate {
    id: control

    implicitWidth                               : Math.max(implicitBackgroundWidth + leftInset + rightInset,
                                                           implicitContentWidth + leftPadding + rightPadding)
    implicitHeight                              : Math.max(implicitBackgroundHeight + topInset + bottomInset,
                                                           implicitContentHeight + topPadding + bottomPadding,
                                                           implicitIndicatorHeight + topPadding + bottomPadding)
    padding                                     : 0
    verticalPadding                             : 8
    horizontalPadding                           : 10
    icon.color                                  : control.palette.text
    contentItem                                 : FilText {
        text                                    : control.text
        font                                    : control.font
        color                                   : {
            if (control.down) {
                return FilColors.Grey120
            }
            return FilColors.Grey220
        }
    }
    background                                  : Rectangle {
        implicitWidth                           : 100
        implicitHeight                          : 30
        color                                   : Qt.rgba(0, 0, 0, 0.05)
        visible                                 : control.down || control.highlighted || control.visualFocus
    }
}
